package org.streamerstudio.ui.preferences;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.layout.TreeColumnLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.ProgressBar;

public class EditTargetPlatformDialog extends TitleAreaDialog {

	/**
	 * Create the dialog.
	 * @param parentShell
	 */
	public EditTargetPlatformDialog(Shell parentShell) {
		super(parentShell);
	}

	/**
	 * Create contents of the dialog.
	 * @param parent
	 */
	@Override
	protected Control createDialogArea(Composite parent) {
		Composite area = (Composite) super.createDialogArea(parent);
		Composite container = new Composite(area, SWT.NONE);
		container.setLayout(new GridLayout(1, false));
		container.setLayoutData(new GridData(GridData.FILL_BOTH));
		// -- component creation
		TabFolder tabFolder = new TabFolder(container, SWT.NONE);
		tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
		// -- component creation
		TabItem locationsTabItem = new TabItem(tabFolder, SWT.NONE);
		locationsTabItem.setText("Locations");
		// -- component creation
		Composite locationComposite = new Composite(tabFolder, SWT.NONE);
		locationsTabItem.setControl(locationComposite);
		locationComposite.setLayout(new GridLayout(2, false));
		// -- component creation
		TreeViewer treeViewer_1 = new TreeViewer(locationComposite, SWT.BORDER);
		Tree tree = treeViewer_1.getTree();
		tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
		tree.setSize(85, 41);
		tree.setHeaderVisible(true);
		tree.setLinesVisible(true);
		// -- component creation
		Button btnAdd = new Button(locationComposite, SWT.NONE);
		btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
		btnAdd.setText("Add...");
		// -- component creation
		Button btnRemove = new Button(locationComposite, SWT.NONE);
		btnRemove.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
		btnRemove.setText("Remove");
		// -- component creation
		TabItem environmentTabItem = new TabItem(tabFolder, SWT.NONE);
		environmentTabItem.setText("Environment");
		// -- component creation
		Composite environmentComposite = new Composite(tabFolder, SWT.NONE);
		environmentTabItem.setControl(environmentComposite);
		// -- component creation
		TabItem contentTabItem = new TabItem(tabFolder, SWT.NONE);
		contentTabItem.setText("Content");
		// -- component creation
		Composite contentComposite = new Composite(tabFolder, SWT.NONE);
		contentTabItem.setControl(contentComposite);
		contentComposite.setLayout(new GridLayout(1, false));
		// -- component creation
		ProgressBar progressBar = new ProgressBar(container, SWT.NONE);
		progressBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

		return area;
	}

	/**
	 * Create contents of the button bar.
	 * @param parent
	 */
	@Override
	protected void createButtonsForButtonBar(Composite parent) {
		createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
				true);
		createButton(parent, IDialogConstants.CANCEL_ID,
				IDialogConstants.CANCEL_LABEL, false);
	}

	/**
	 * Return the initial size of the dialog.
	 */
	@Override
	protected Point getInitialSize() {
		return new Point(450, 300);
	}
}
